import React from 'react'
import { Link, connect, useDispatch, useSelector, } from 'umi';
import { Button } from 'antd'
import { requestVideo } from '@/services/video';
// @connect(({ user }) => ({
//     user,
//   }))
export default function index() {
    const dispatch = useDispatch();
    const user = useSelector((state: any) => {
        console.log(state, 'sss');

        return state.user
    });
    console.log(user, 'uuu');
    const handVideoMock = async () => {
        const a = await requestVideo();
        console.log('aa',a);
        
    }
    return (
        <div>
            video <br />
            <Link to={'/home'}>home |{user.users}</Link>
            <Button onClick={() => dispatch({ type: 'user/initVideo', payload: 'jiayi' })}>dispath</Button>
            <Button onClick={handVideoMock}>dorequest</Button>
        </div>
    )
}
